<div class="container_16">
    <div class="push_1 grid_12 containerHeight">
        <table width="100%" id="acciones">
            <thead>
                <tr>
                    <th style="display: none;">sdasda</th>
                    <th><?= lang("ticker"); ?></th>
                    <th><?= lang("valor"); ?></th>
                    <th><?= lang("accionesDisponibles"); ?></th>
                    <th><?= lang("max"); ?></th>
                    <th><?= lang("min"); ?></th>
                    <th><?= lang("capital"); ?></th>
                    <th><?= lang("hora"); ?></th>
                    <th><?= lang("comprar"); ?></th>
                </tr>
            </thead>
            <?php foreach ($accionesEmpresa as $a): ?>
                <tr class="link">
                    <td class="id" style="display: none;" id="<?= $a->id ?>"></td>
                    <td><?= $a->ticker ?></td>
                    <td><?= number_format($a->valor, 2, ',', '.') ?></td>
                    <td><?= number_format($a->accionesDisponibles, 0, ',', '.') ?></td>
                    <td><?= number_format($a->max, 2, ',', '.') ?></td>
                    <td><?= number_format($a->min, 2, ',', '.') ?></td>
                    <td><?= number_format($a->capital, 2, ',', '.') ?></td>
                    <td><?= $a->hora ?></td>
                    <td><a style="text-decoration: none" href="backend/inversiones/inversiones/comprarAcciones/<?= $a->id ?>"><img id="imagen<?= $a->id ?>" src="/images/inversiones/comprar.png" alt=""><label for="imagen<?= $a->id ?>"><?= lang("comprar"); ?></label></a></td>
                </tr>
            <?php endforeach; ?>
            </table>
        </div>
    </div>
    <script>
        $(document).ready(function() {
            $('#acciones').dataTable({
                "bJQueryUI": true,
                "bInfo": false,
                "bSort": true,
                "bAutoWidth": false,
                "bPaginate": true,
                "oLanguage": {
                    "sUrl": "<?= lang('datatables_lng') ?>"
            }
        });

        $('#acciones tbody tr').live('click', function () {
            var ide = $(this).children(":first").attr("id");
            window.location = "backend/inversiones/inversiones/comprarAcciones/" + ide;
        });
    });
</script>
<style>
    .dataTables_filter{
        display: none;
    }
    .link {
        cursor: pointer;
    }
</style>